package com.jdbcbase.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jdbcbase.module.Menu;
import com.jdbcbase.service.MenuService;

@Controller
@RequestMapping("/menu")
public class MenuController {
	@Resource
	private MenuService menuService;
	
	//http://localhost:8080/springMvc/menu/getMenuList
	@RequestMapping("/getMenuList")
	@ResponseBody
	public List<Menu> getMenuList(){
		Menu menu = new Menu();
		menu.setOrderNo(1);
		menu.setMenuId("bcd3e794-e032-406d-a415-7b2b20b4df88");
		List<Menu> list = menuService.queryMenu(menu);
		return list;
	}
	@RequestMapping("/getMenuListMap")
	@ResponseBody
	public List<Map> getMenuListMap(){
		Menu menu = new Menu();
		menu.setOrderNo(1);
		menu.setMenuId("bcd3e794-e032-406d-a415-7b2b20b4df88");
		List<Map> list = menuService.queryMenuMap(menu);
		return list;
	}
	@RequestMapping("/getMenuForOne")
	@ResponseBody
	public Menu getMenuForOne(){
		String str = "";
		Menu menu2 = menuService.queryMenuForOne(str);
		return menu2;
	}
}
